using System;
using System.Collections.Generic;
using System.Text;
using Common.Shared.Design;
using System.ComponentModel;

namespace Common.Shared.Xml.Wddx {
	[WddxRoot("boolean")]
	public class WddxBoolean : WddxPrimitiveDataTypeObject {
		private bool _value = false;

		public WddxBoolean ( ) {

		}

		public WddxBoolean ( bool value ) {
			this.Value = value;
		}

		
		public new bool Value {
			get { return this._value; }
			set { this._value = value; }
		}

		[WddxText]
		[EditorBrowsable ( EditorBrowsableState.Never ), Browsable ( false )]
		public string ValueString {
			get { return this.Value.ToString ( ).ToLower ( ); }
			set { this.Value = string.Compare ( value, bool.TrueString, true ) == 0; }
		}
	}
}
